// API 接口类型定义
export interface BaseResponse<T = any> {
  code: number;
  data: T;
  message: string;
}

// 用户相关类型
export interface User {
  id: number;
  userAccount: string;
  userName?: string;
  userAvatar?: string;
  userProfile?: string;
  userRole: string;
  createTime: string;
  updateTime: string;
}

export interface UserRegisterRequest {
  userAccount: string;
  userPassword: string;
  checkPassword: string;
}

export interface UserLoginRequest {
  userAccount: string;
  userPassword: string;
}

export interface UserUpdateMyRequest {
  userName?: string;
  userAvatar?: string;
  userProfile?: string;
}

// 图表相关类型
export interface Chart {
  id: number;
  name: string;
  goal?: string;
  chartData?: string;
  chartType?: string;
  genChart?: string;
  genResult?: string;
  status: string;
  execMessage?: string;
  userId: number;
  createTime: string;
  updateTime: string;
}

export interface ChartAddRequest {
  name: string;
  goal?: string;
  chartData?: string;
  chartType?: string;
}

export interface ChartEditRequest {
  id: number;
  name?: string;
  goal?: string;
  chartData?: string;
  chartType?: string;
}

export interface ChartUpdateRequest {
  id: number;
  name?: string;
  goal?: string;
  chartData?: string;
  chartType?: string;
  genChart?: string;
  genResult?: string;
}

export interface ChartQueryRequest {
  current?: number;
  pageSize?: number;
  sortField?: string;
  sortOrder?: string;
  id?: number;
  name?: string;
  goal?: string;
  chartType?: string;
  userId?: number;
}

// 分页响应类型
export interface PageResponse<T> {
  records: T[];
  pageNumber: number;
  pageSize: number;
  totalPage: number;
  totalRow: number;
  optimizeCountQuery?: boolean;
}

// 图表生成请求
export interface GenChartByAiRequest {
  name: string;
  goal?: string;
  chartType?: string;
}

// BI响应类型
export interface BiResponse {
  genChart: any;
  genResult: string;
  chartId: number;
}